package com.chinasoft04.mall.mapper;

import com.chinasoft04.mall.pojo.AuthPermission;
import com.chinasoft04.mall.pojo.AuthPermissionPlus;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SpPermissionMapper {

    @Select("SELECT * FROM sp_permission")
    List<AuthPermission> getAllAuthPermission();

    @Select("SELECT * FROM sp_permission as a, sp_permission_api as b WHERE a.ps_id = b.ps_id")
    List<AuthPermissionPlus> getAllAuthPermissionPlus();

    @Select("SELECT * FROM sp_permission as a, sp_permission_api as b WHERE a.ps_id = #{id} AND a.ps_id = b.ps_id")
    AuthPermissionPlus getPermissionPlusById(Integer id);
}
